A well, such as an oil or gas well for extracting hydrocarbon fluids from a subterranean formation, can include various tools positioned in a wellbore. In some wells, tools may remain downhole permanently or indefinitely to perform delayed operations in the wellbore. Temperatures naturally present in the wellbore can be high. The temperatures naturally present in the wellbore can significantly damage power supplies positioned downhole. For example, some batteries positioned in a wellbore can degrade over time due to the temperatures naturally present in the wellbore. Some batteries, such as some lithium batteries can catch fire at temperatures above 180° C. and present a safety concern. Some lithium batteries can be costly to ship in part due to their instability, which can limit the modes for transporting some lithium batteries. For example, some lithium batteries are not allowed to be transported by plane due to safety concerns. The conditions in some wellbores are so harsh that some tools cannot be used in the wellbore because existing batteries cannot be used in the wellbore to power the tools.